package stream;

import java.util.stream.Stream;

public class Concat {
    public static void main(String[] args) {
        Stream<String> stream1 = Stream.of("aa", "cc");
        Stream<String> stream2 = Stream.of("bb", "dd");
        Stream.concat(stream1,stream2)
                .sorted()
                .forEach(System.out::println);

        System.out.println("====================");
        // 跳过skip
        // 截断limit
        Stream.of("aa","bb","cc","dd","ee","ff")
                .skip(2)
                .limit(3)
                .forEach(System.out::println);

    }
}
